<%@ page import="org.apache.catalina.User" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<title>用户功能页面</title>
<%
    String name = null;
    String sex = null;
    String grade = null;
    HttpSession session1 = request.getSession(false);
    if (session1 == null || session1.getAttribute("id") == null) {
        response.sendRedirect(request.getContextPath() + "/index.jsp");
    } else {
        name = (String) session1.getAttribute("name");
        sex = (String) session1.getAttribute("sex");
        grade = (String) session1.getAttribute("grade");
    }

    com.po.User user = (com.po.User) request.getAttribute("user");
%>

<h2>欢迎回来 <%=name%><%=sex%>
</h2>
<%
    if("administrator".equals(session.getAttribute("duty"))){
%>
<div style="text-align: center">
    <h3>你是系统管理员</h3>
</div>
<%
    }
%>
您的等级是：<%=grade%><br>
你的id是:<%=session.getAttribute("id")%>
<div align="end">
    <a class="title" href="<%=request.getContextPath()%>/personalInformation">编辑个人信息</a><br><br><br>
    <a class="title" href="<%=request.getContextPath()%>/friend/myInbox">我的邮件箱</a>
</div>

<hr>
<div align="center">
    <a class="title" href="<%=request.getContextPath()%>/function/myEnvelope">查看自己的信封</a><br><br><br>
    <a class="title" href="<%=request.getContextPath()%>/function/openEnvelope">前往公开信封区</a><br><br><br>
    <a class="title" href="<%=request.getContextPath()%>/selectFriend.jsp">添加好友</a><br><br><br>
    <a class="title" href="<%=request.getContextPath()%>/myFriends">好友列表</a><br><br><br>

    <%
        if("administrator".equals(session.getAttribute("duty"))){
    %>
        <a class="title" href="<%=request.getContextPath()%>/selectFrozen">查看被冻结人员名单</a><br><br><br>
    <%
        }
    %>
    <a class="title" href="<%=request.getContextPath()%>/exit">【退出系统】</a>
</div>
<style>
    body {
        background-image: url("picture/new.jpg");
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-position: center center;
        background-size: 100% 100%;
    }
</style>
<style type="text/css">
    .title:link{
        color: blue;
    }
    .title:visited{
        color: green;
    }
    .title:hover{
        color: white;;
        font-size: 200%;
        background: pink;
        text-decoration: none;
    }
</style>